<template>
    <div>
      <ul class="alphabet">
        <li v-for="(item, key) of cityData.cities"
            :key="key"
            @click="jumpToKey"
        >{{key}}</li>
      </ul>
    </div>
</template>

<script>
export default {
  name: 'Alphabet',
  props: {
    cityData: Object
  },
  methods: {
    jumpToKey (e) {
      this.$emit('jumpLetter', e.target.innerHTML)
    }
  }
}
</script>

<style lang='scss' scoped>
  .alphabet {
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: fixed;
    top: 184px;
    bottom: 0;
    right: 0;
    width: 30px;
    color: #3190e8;
    text-align: center;
    z-index: 2;
    li {
      height: 30px;
    }
  }
</style>
